﻿<#assign ctx=request.contextPath>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="${ctx}/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/h-ui/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/h-ui/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/h-ui/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>我的桌面</title>
<style type="text/css">
	p{
		text-indent: 2em;
	}
</style>
</head>
<body>

<div class="page-container">
	<p style="text-indent: 0em" class="f-20 text-success">欢迎使用E购通后台管理系统</p>
	<form id="headForm" method="post" enctype="multipart/form-data" >
		<p>
			<#if session_user.userHeadImg??>
				<img id="headShow" style="width: 120px;height: 100px;" alt="" src="${ctx}/file/upload/${session_user.userHeadImg}">			
				<#else>
				<img id="headShow" style="width: 120px;height: 100px;" alt="" src="${ctx}/file/aa.jpg">			
			</#if>
			<input type="file" name="headImg" >
			<input type="submit" value="上传头像" >
		</p>
	</form>
	<p>用户：${session_user.user_id}</p>
	<p>昵称：${session_user.name}</p>
	<#if session_user.sex=1>
		<p>性别：男</p>
		<#else>
		<p>性别：女</p>
	</#if>
	
	<p>生日：${session_user.birthday?string("yyyy-MM-dd")}</p>
	<p>邮箱：${session_user.email}</p>
	<p>电话：${session_user.phone}</p>
	<#if session_user.role=2>
		<p>权限：管理员</p>
		<#else>
		<p>权限：超级管理员</p>
	</#if>
	
	<p>创建时间：${session_user.create_date?string("yyyy-MM-dd")}</p>

</div>

<script type="text/javascript" src="${ctx}/static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="${ctx}/static/lib/jquery/jquery.form.js"></script> 
<script type="text/javascript" src="${ctx}/static/h-ui/js/H-ui.js"></script> 
<script>
	$(function(){
		$('#headForm').ajaxForm({
		       url:"${ctx}/admin/user/userPicAjax",
		       type:"POST",
		       dataType:"json",
		       async:true,
		       success:function(data){

		    	     if(data.status == "success"){
		    	    	//上传成功，通过js回显到页面
		    	    	$("#headShow").attr("src","${ctx}/file/upload/"+data.fileName);

		    	    } 
		    	  
		       },
		       error:function(){
		    	   alert("文件上传失败!");
		       }
		    });
	})
</script>
</body>
</html>